package top.springcloud.FeignConsumer.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import top.springcloud.FeignConsumer.fallback.CustomerServiceImpl;
import top.springcloud.customer.entity.Customer;

/**
 * @ClassName CustomerService
 * @Description TODO
 * @Author 维康
 * @Date 2018/8/16 15:06
 * @Version 1.0
 **/
@Service("customerService")
@FeignClient(name = "zuul-api-getway",fallback = CustomerServiceImpl.class)
public interface CustomerService {

    @RequestMapping(value = "/customer-api/customer/get/{customerId}",method = RequestMethod.GET)
    String getCustomerById(@PathVariable("customerId") Integer customerId);

    @RequestMapping(value = "/customer-api/customer/save",method = RequestMethod.POST)
    Customer saveCustomer(@RequestBody Customer customer);
}
